/***************************************************************************
*   Group Members: Carl Huskey, Dawne Flanagan
*	
*	Packet
*	=====================
*	This class is used to create a packet object that can be sent to the server to be processed.
**/

import java.net.*;

public class Packet
{
	// declare variables
    private String message;
	private InetAddress myIP;
	private InetAddress sendTo;
	private int port;
	private int jobType;

	//default constructor
	public Packet(){
		message = null;
		myIP = null;
		sendTo = null;
		port = -1;
		jobType = -1;
	}
	
	// overloaded method
    public Packet(InetAddress sendTo, InetAddress myIP, int port, String message, int jobType)
	{
		this.myIP = myIP;
		this.sendTo = sendTo;
		this.port = port;
		this.message = message;
		this.jobType = jobType;
	}
	/*
		 get and set message, ip, port, and job
	*/
	public void setMessage(String message)
	{
		this.message = message;
	}

	public void setIPofSender(InetAddress myIP)
	{
		this.myIP = myIP;
	}
	
	public void setIPofDestination(InetAddress sendTo)
	{
		this.sendTo = sendTo;
	}

	public void setPort(int port)
	{
		this.port = port;
	}

	public void setJob(int job)
	{
		this.jobType = job;
	}

	public String getMessage()
	{
		return message;
	}

	public InetAddress getIPofSender()
	{
		return myIP;
	}
	
	public InetAddress getIPofDestination()
	{
		return sendTo;
	}

	public int getPort()
	{
		return port;
	}

	public int getJob()
	{
		return this.jobType;
	}
}
